package service

import (
	"context"
	"demo/domain/model"
	"demo/domain/service"
)

type UserService struct {
	userInfoService *service.UserInfoService
}

// NewUserService 构造函数
func NewUserService(userInfoService *service.UserInfoService) *UserService {
	return &UserService{userInfoService: userInfoService}
}

// Register 注册用户（应用层用例）
func (s *UserService) Register(ctx context.Context, username, password string) error {
	return s.userInfoService.Register(ctx, username, password)
}

// Login 登录验证
func (s *UserService) Login(ctx context.Context, username, password, loginIp string) (*model.UserSimple, error) {
	return s.userInfoService.Login(ctx, username, password, loginIp)
}
